<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich">
    <style>
        .col, .col2 {
            width:50%;
            vertical-align:top;
        }
        .gridhello {
            border-collapse : collapse;
        }
        .gridhellocolumn {
            padding-left : 0;
        }
        .pic{
            margin-bottom: -4px;
            margin-right: 2px;
            border:none;
        }
    </style>
    <h:form>
        <rich:panel header="财务文档" styleClass="content-hight">
            <h:panelGrid columns="2" width="100%" columnClasses="col1,col2"  id="edit">
                <rich:tree value="#{documentUpdateBean.treeNode}"
                           var="idocumentType"
                           selectionChangeListener="#{documentUpdateBean.selectedDocumentType2}"
                           selectionType="ajax"
                           style="width:200px;"
                           render="editTable,documentTypeInfo">
                    <rich:treeNode>
                        <h:outputText value="[#{idocumentType.data.id}]#{idocumentType.data.name}" />
                    </rich:treeNode>
                </rich:tree>
            </h:panelGrid>

            <hr/>
            <h:panelGroup id="editTable">
            <rich:dataTable value="#{documentUpdateBean.doclist}" var="doc"
                            rows="10"
                            style="width:100%;"
                            styleClass="stable">
                <rich:column style="text-align:center;">
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="编号"/>
                        </h:panelGroup>
                    </f:facet>               
                    <h:outputText value="#{doc.id}"/>
                </rich:column>
                <rich:column sortBy="#{doc.title}">
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="文档标题"/>
                        </h:panelGroup>
                    </f:facet>
                    <h:outputText value="#{doc.title}"/>
                </rich:column>
                <rich:column sortBy="#{doc.uploadDate}">
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="上传日期"/>
                        </h:panelGroup>
                    </f:facet>
                    <h:outputText value="#{doc.uploadDate}">
                        <f:convertDateTime  dateStyle="medium"/>
                    </h:outputText>
                </rich:column>
                <rich:column sortBy="#{doc.userName}">
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="上传人员"/>
                        </h:panelGroup>
                    </f:facet>
                    <h:outputText value="#{doc.userName}"/>
                </rich:column>
                <rich:column sortBy="#{doc.docSize}">
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="文件大小"/>
                        </h:panelGroup>
                    </f:facet>
                    <h:outputText value="#{doc.docSize}"/>
                </rich:column>
                <rich:column sortBy="#{doc.description}">
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="文档描述"/>
                        </h:panelGroup>
                    </f:facet>
                    <h:outputText value="#{doc.description}"/>
                </rich:column>
                <rich:column style="text-align: center;">
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="下载"/>
                        </h:panelGroup>
                    </f:facet>
                    <h:commandLink rendered="#{doc.showflag}" action="#{documentUpdateBean.download(doc)}">
                        <h:outputText value="下载" rendered="#{doc.showflag}"/>
                    </h:commandLink>
                    <h:outputText value="文档已不存在" rendered="#{doc.showflag==false}"/>
                </rich:column>
                <f:facet name="footer">
                    <rich:dataScroller id="ds"></rich:dataScroller>
                </f:facet>
            </rich:dataTable>
            </h:panelGroup>
        </rich:panel>
    </h:form>

</ui:composition>

